<template>

    <div class="dashboard-container">
      
      <div class="big-back-box">
        <div class="top">订单评价</div>
        <el-card class="box-card" style="width: 500px; margin: 0 auto">
          <el-rate v-model="evaluation.evaluationGrade" show-text style="margin-top:20px; margin-bottom:30px"> </el-rate>
          <el-input
            v-model="evaluation.evaluationContent"
            type="textarea"
            placeholder="请输入评价内容"
            rows="5"
          />
            <el-button style="margin-top:18px;float: right;" @click="addEvaluation"
            type="success"
            >确定</el-button>
        </el-card>
      </div>
    </div>
</template>

<script>

import {addOrderEvaluation} from "@/api/order"
export default {
  
  data() {
    return {  
        evaluation:{
          evaluationContent:"",//评价内容
          evaluationGrade:null,//评价等级
          orderId:0,//订单id
        }
    };
  },
   methods:{
     addEvaluation(){
      this.evaluation.orderId=this.$route.query.id;
      addOrderEvaluation(this.evaluation).then(res=>{
        let {data}=res;
        if(data.result){
          this.$message("评价成功");
          this.$router.push({path:"/customerCenter/customerOrder/orderList"})
        }
      })
     }
    }
};
</script>

<style lang="scss" scoped>
// 页头LOGO
.top {
  height: 50px;
  font-size: 30px;
  text-align: center;
  line-height: 50px;
}

// 大盒子
.big-back-box {
  width: 1080px;
  margin: 0 auto;
}

// 原框架自带
.dashboard {
  &-container {
    margin-top: 30px;
    // margin-left: 30px;
    // margin-right: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>